package com.sjc.algorithm.leetcode;

import java.util.ArrayList;
import java.util.List;

/**
 * @author by SangJiacun
 * @Date 2020/5/15 00:03
 */
public class P1431 {
    public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
        int max = 0;
        for(int i=0;i<candies.length;i++){
            if(max < candies[i]){
                max = candies[i];
            }
        }

        List<Boolean> result = new ArrayList<>();
        for(int i=0;i< candies.length;i++){
            if(candies[i] + extraCandies >= max){
                result.add(true);
            }else{
                result.add(false);
            }
        }
        return result;
    }
}
